@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="wzQuestionInfoForm">

            <input type="hidden" id="questionId" value="${item.questionId}">
            <input type="hidden" id="type" value="${item.type}">
            <input type="hidden" id="questionType" value="${item.questionType}">
            <div class="row">
                <div class="col-sm-9">
                    <#input id="question" name="问题" value="${item.question}" disabled="${item.status!=1?'disabled':''}"/>
                    <#input id="" name="问题类型" value="${type}" disabled="disabled"/>
                    <#input id="" name="问题形式" value="${questionType}" disabled="disabled"  underline="true"/>
                </div>
                @if(item.status==1){
                    <div class="col-sm-12" id="itemsArea">
                        <div class="form-group" >
                            <div class="col-sm-2" style="padding-left: 8%">
                                <#button btnCss="info" name="增加问题" icon="fa-plus" clickFun="WzQuestionEditDlg.addItem()"/>
                            </div>
                        </div>
                    </div>
                @}
           </div>
        @if(item.type==2){
             @for(items in answerList){
             <!-- 广告问题-->
                @if(item.questionType==1){
                    <div class="form-group" name="dictItem" id="dictItem${itemsLP.index}" style="margin-left: 0.001%">
                        <label class="col-sm-2 control-label">答案</label>
                        <div class="col-sm-2">
                        <input  type="hidden" id="answerId" value="${items.answerId}">
                            <input class="form-control" type="text" name="itemNum" value="${items.answer}"style="width: 420px;"  maxlength="30" ${item.status!=1?'disabled':''}/>
                        </div>
                        <label class="col-sm-1 control-label" style="margin-left: 300px;">正确</label>
                            <input type="radio" name="answer"  id="${itemsLP.index+64}" style="margin-top: 10px;" ${items.isTrue==1?'checked':''} ${item.status!=1?'disabled':''}/>
                        @if(item.status==1){
                            <div class="col-sm-4" style="margin-left:85%;margin-top: -3.5%;">
                                <#button btnCss="danger" name="删除" id="cancel" icon="fa-remove" clickFun="WzQuestionInfoDlg.deleteAnswer(event,${items.answerId},${itemsLP.index+64})"/>
                            </div>
                        @}
                    </div>
                @}
                @if(item.questionType==2){
                    <div name="dictItem" id="dictItem${itemsLP.index}" >
                    <div class="form-group">
                        <div>
                        <label class="col-sm-2 control-label">答案</label>
                           <div style='margin-bottom: 1.03%' class="col-sm-10">
                               <input  type="hidden" id="answerId" value="${items.answerId}">
                               <input type="title" class="form-control" name="itemNum" value="${items.answer}" style="width: 70%;" >
                           </div>
                            <label class="col-sm-2 control-label">图片id</label>
                            <div class="col-sm-10" >
                                    <input type="pic" class="form-control"  value="${items.answerPic}" style="width: 20%;" >
                                   <div style='margin-top: -3.6%;margin-left: 31.3%'>
                                           <label>正确</label>
                                           <input  type="radio" name="answer" id="${itemsLP.index+64}" ${items.isTrue==1?'checked':''} ${item.status!=1?'disabled':''}/>
                                   </div>
                                </div>
                        </div>
                    </div>
                    <div style="margin-left: 15.1%;margin-bottom: 2%"><button onclick="WzQuestionInfoDlg.deleteAnswer(event,${items.answerId},${itemsLP.index+64})" style='margin-top: -1.2%' type="button" class="btn btn-danger button-margin" >
                    <i class="fa fa-remove"></i>&nbsp;删除</button></div>
                    </div>
                @}
             @}
        @}
        @if(item.type==1||item.type==3){
            @for(items in answerList_1){
            <!-- 调查、商家问卷-->
                @if(item.questionType==1){
                <div class="form-group" name="dictItem" id="dictItem${itemsLP.index}" style="margin-left: 001%">
                    <label class="col-sm-2 control-label">答案</label>
                    <div class="col-sm-2">
                        <input  type="hidden" id="answerId_1" value="${items.answerId}">
                        <input class="form-control" type="text" name="itemNum" value="${items.answer}" style="width: 350px;"  maxlength="30" ${item.status!=1?'disabled':''}>
                    </div>
                    @if(item.status==1){
                        <div class="col-sm-4" style="margin-left:75%; margin-top: -3.5%;">
                            <#button btnCss="danger"  name="删除" id="cancel" icon="fa-remove" clickFun="WzQuestionInfoDlg.deleteAnswer_1(event,${items.answerId})"/>
                        </div>
                    @}
                </div>
                @}
                @if(item.questionType==2){
                <div name="dictItem" id="dictItem${itemsLP.index}">
                    <div class="form-group">
                        <div>
                            <label class="col-sm-2 control-label">答案</label>
                            <div style='margin-bottom: 1.03%' class="col-sm-10">
                                <input  type="hidden" id="answerId_1" value="${items.answerId}">
                                <input type="title" name="itemNum" class="form-control" value="${items.answer}" style="width: 70%;" >
                            </div>
                            <label class="col-sm-2 control-label">图片id</label>
                            <div class="col-sm-10" >
                                <input type="pic" class="form-control"  value="${items.answerPic}" style="width: 20%;" >
                            </div>
                        </div>
                    </div>
                    <div style="margin-left: 15.1%;margin-bottom: 2%"><button onclick="WzQuestionInfoDlg.deleteAnswer_1(event,${items.answerId})" style='margin-top: -1.2%' type="button" class="btn btn-danger button-margin" >
                        <i class="fa fa-remove"></i>&nbsp;删除</button></div>
                </div>
                @}
            @}
        @}

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="WzQuestionInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="WzQuestionInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>

</div>



<!--新增答案start-->
<script type="text/template" id="itemTemplate">
    <!-- 广告问题-->
    <div class="form-group" name="dictItem" id="dictItem" style="margin-left: -0.001%">
        <label class="col-sm-2 control-label">答案</label>
        <div class="col-sm-2">
            <input class="form-control" type="text" name="itemNum" id="answer" style="width: 420px;"  maxlength="30">
        </div>
        <label class="col-sm-1 control-label" style="margin-left: 300px;">正确</label>
            <input type="radio" name="answer" id="choice"  style="margin-top: 10px;">
        <div class="col-sm-4" style="margin-left:85%;margin-top: -3.5%;">
            <#button btnCss="danger"  name="删除" id="cancel" icon="fa-remove" clickFun="WzQuestionInfoDlg.deleteItem(event)"/>
        </div>
    </div>
</script>


<script type="text/template" id="itemTemplate_1">
    <!-- 调查、商家问卷-->
    <div class="form-group" name="dictItem" id="dictItem_1" style="margin-left: 0.001%">
        <label class="col-sm-2 control-label">答案</label>
        <div class="col-sm-2">
            <input class="form-control" type="text" name="itemNum" id="answer_1"style="width: 350px;"  maxlength="50">
        </div>
        <div class="col-sm-4" style="margin-left:75%; margin-top: -3.5%;">
            <#button btnCss="danger"  name="删除" id="cancel" icon="fa-remove" clickFun="WzQuestionInfoDlg.deleteItem(event)"/>
        </div>
    </div>
</script>

<script type="text/template" id="itemTemplate_2">
    <!-- 调查、商家问卷-->
    <div class="form-group" name="dictItem" id="dictItem_2" style="margin-left: 0.001%">
        <label class="col-sm-2 control-label">答案</label>
        <div class="col-sm-2">
            <input class="form-control" type="text" name="itemNum" id="answer_2"style="width: 350px;"  maxlength="50">
        </div>
        <div class="col-sm-4" style="margin-left:75%; margin-top: -3.5%;">
            <#button btnCss="danger"  name="删除" id="cancel" icon="fa-remove" clickFun="WzQuestionInfoDlg.deleteItem(event)"/>
        </div>
    </div>
</script>
<!--新增答案end-->
<script src="${ctxPath}/static/modular/wz/wzQuestion/wzQuestion_info.js"></script>
<script src="${ctxPath}/static/modular/wz/wzQuestion/wzQuestion_edit.js"></script>

@}
